{% block sw_condition_modal %}
<sw-modal
    class="sw-condition-modal"
    variant="large"
    :title="$tc('sw-settings-rule.conditionModal.modalTitle')"
    @modal-close="closeModal"
>
    {% block sw_condition_modal_tree %}
    <sw-condition-tree
        v-bind="{ initialConditions, scopes, allowedTypes, conditionRepository, conditionDataProviderService }"
        :root-condition="condition"
        association-field="ruleId"
        :association-value="condition.ruleId"
        :child-association-field="childAssociationField"
        @conditions-changed="onConditionsChanged"
    />
    {% endblock %}

    {% block sw_condition_modal_footer %}
    <template #modal-footer>
        {% block sw_condition_modal_footer_cancel %}
        <mt-button
            size="small"
            variant="secondary"
            @click="$emit('modal-close')"
        >
            {{ $tc('global.default.cancel') }}
        </mt-button>
        {% endblock %}

        {% block sw_condition_modal_footer_save %}
        <mt-button
            variant="primary"
            size="small"
            @click="saveAndCloseModal"
        >
            {{ $tc('global.default.save') }}
        </mt-button>
        {% endblock %}
    </template>
    {% endblock %}
</sw-modal>
{% endblock %}
